OpenStack Juno : Configure Neutron#1 ( Control Node )
2015/01/09 |
Configure OpenStack Network Service (Neutron).
For this example, Install Neutron Server on Control Node which Keystone/Glance/Nova API are already installed,
and Install DHCP Agent, L3 Agent, L2 Agent, Metadata Agent on Network Node, and also Install L2 Agent on Compute Node on here.
( it's possible to install on a server as All-in-One, though, if you want )
Neutron needs a plugin software, it's possible to choose it from some softwares.
This example chooses ML2 plugin. ( it uses Open vSwitch under the backend )
| +------------------+ | +------------------------+ | [ Control Node ] | | | [ Network Node ] | | Keystone |10.0.0.30 | 10.0.0.50| DHCP Agent | | Glance |------------+------------| L3 Agent | | Nova API |eth0 | eth0| L2 Agent | | Neutron Server | | | Metadata Agent | +------------------+ | +------------------------+ eth0|10.0.0.51 +--------------------+ | [ Compute Node ] | | Nova Compute | | L2 Agent | +--------------------+ |
Configure Control Node on here.
|
|
[1] | Add user or service for Neutron to Keystone. |
# add Neutron user or service [root@dlp ~(keystone)]# keystone user-create --tenant service --name neutron --pass servicepassword --enabled true +----------+----------------------------------+ | Property | Value | +----------+----------------------------------+ | email | | | enabled | True | | id | 45a241a04f81415b9ee2a0f873d65f29 | | name | neutron | | tenantId | 9e657ab1d2344de5aa9d86006732c7f0 | | username | neutron | +----------+----------------------------------+
[root@dlp ~(keystone)]#
[root@dlp ~(keystone)]# keystone user-role-add --user neutron --tenant service --role admin
keystone service-create --name=neutron --type=network --description="Neutron Network Service" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | description | Neutron Network Service | | enabled | True | | id | 27bba582d83a42b4818177bf6da16dff | | name | neutron | | type | network | +-------------+----------------------------------+ # define Neutron Server's IP [root@dlp ~(keystone)]# export neutron_server=10.0.0.30
keystone endpoint-create --region RegionOne \ --service neutron \ --publicurl "http://$neutron_server:9696/" \ --internalurl "http://$neutron_server:9696/" \ --adminurl "http://$neutron_server:9696/" +-------------+----------------------------------+ | Property | Value | +-------------+----------------------------------+ | adminurl | http://10.0.0.30:9696/ | | id | d6c5d66874524f938da9e5490980cb89 | | internalurl | http://10.0.0.30:9696/ | | publicurl | http://10.0.0.30:9696/ | | region | RegionOne | | service_id | 27bba582d83a42b4818177bf6da16dff | +-------------+----------------------------------+ |
[2] | Add a User and DB for Neutron to MariaDB. |
[root@dlp ~(keystone)]# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 14 Server version: 5.5.40-MariaDB-wsrep MariaDB Server, wsrep_25.11.r4026 Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]>
create database neutron_ml2; Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on neutron_ml2.* to neutron@'localhost' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on neutron_ml2.* to neutron@'%' identified by 'password'; Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) exit Bye |
[3] | Install Neutron Server. |
[root@dlp ~(keystone)]# yum --enablerepo=openstack-juno,epel -y install openstack-neutron openstack-neutron-ml2
|
[4] | Configure Neutron Server. |
[root@dlp ~(keystone)]#
vi /etc/neutron/neutron.conf # line 65: add core_plugin=ml2
# line 74: add service_plugins=router
# line 81: add auth_strategy=keystone
# line 106: uncomment dhcp_agent_notification=True # line 243: uncomment and change (specify Nova endpoint) nova_url= http://10.0.0.30:8774/v2
# line 249: uncomment and change (specify Nova user) nova_admin_username= nova
# line 252: uncomment and change (specify Nova user's tenant ID) nova_admin_tenant_id= 9e657ab1d2344de5aa9d86006732c7f0
# line 255: uncomment and change (specify Nova user's password) nova_admin_password= servicepassword
# line 258: uncomment and change (specify Keystone server) nova_admin_auth_url= http://10.0.0.30:35357/v2.0
# line 343: uncomment and change (specify RabbitMQ server) rabbit_host= 10.0.0.30
# line 347: uncomment rabbit_port=5672 # line 356: uncomment and change (specify RabbitMQ user) rabbit_userid= guest
# line 359: uncomment and change (specify RabbitMQ user's password) rabbit_password= password
# line 444: uncomment rpc_backend=rabbit # line 450: add control_exchange=neutron
# line 555: uncomment and change like follows (auth info for Keystone) [keystone_authtoken] auth_host = 10.0.0.30 auth_port = 35357 auth_protocol = http admin_tenant_name = service admin_user = neutron admin_password = servicepassword
# line 574: change (specify database) connection = mysql://neutron:password@10.0.0.30/neutron_ml2
# line 622: comment out # service_provider=LOADBALANCER:Haproxy:neutron.services.loadbalancer.
drivers.haproxy.plugin_driver.HaproxyOnHostPluginDriver:default
[root@dlp ~(keystone)]#
vi /etc/neutron/plugins/ml2/ml2_conf.ini # line 7: add
type_drivers = flat,vlan,gre
tenant_network_types = vlan,gre mechanism_drivers = openvswitch # line 69: uncomment and add enable_security_group = True firewall_driver = neutron.agent.linux.iptables_firewall.OVSHybridIptablesFirewallDriver
[root@dlp ~(keystone)]#
vi /etc/nova/nova.conf # add in the [DEFAULT] section network_api_class=nova.network.neutronv2.api.API security_group_api=neutron ln -s /etc/neutron/plugins/ml2/ml2_conf.ini /etc/neutron/plugin.ini [root@dlp ~(keystone)]# neutron-db-manage --config-file /etc/neutron/neutron.conf --config-file /etc/neutron/plugin.ini upgrade head [root@dlp ~(keystone)]# systemctl start neutron-server [root@dlp ~(keystone)]# systemctl enable neutron-server [root@dlp ~(keystone)]# systemctl restart openstack-nova-api |